<template>
  <div
    class="tableClass1"
    style="overflow-x:hidden;overflow-y: auto;overflow: scroll;height: 100%;"
  >
    <a-tabs style="margin:30px" :defaultActiveKey="type==='small'?'2':'1'" @change="callback">
     <a-tab-pane tab="一般信息变更" key="1" v-if="type !='small'">
        <keep-alive>
          <router-view />
        </keep-alive>
      </a-tab-pane>
    
      <a-tab-pane tab="重要信息变更" key="2">
        <keep-alive>
          <router-view />
        </keep-alive>
      </a-tab-pane>
      <a-tab-pane v-if="type!='small'" tab="受益所有人变更" key="4">
        <keep-alive>
          <router-view />
        </keep-alive>
      </a-tab-pane>
      <a-tab-pane tab="业务变更" key="3">
        <keep-alive>
          <router-view />
        </keep-alive>
      </a-tab-pane>
    </a-tabs>
  </div>
</template>
<script>
export default {
  data() {
    return {
      type:'',
      actived: 1
    };
  },
  created() {
    console.log('route', this.$route);
    this.type=this.$route.params.type
  },
  
  mounted() {
    this.type == 'small'? this.actived = 2 : this.actived = 1
    this.callback(this.actived);
  },
  methods: {
    callback(key) {
      console.log(key);
      if (key == 1) {
        this.$router.push({
          path: `/OrgRegister/orgInfoModify/comInfoModify/${this.$route.params.id}/${this.$route.params.type}`
        });
      } else if (key == 2) {
        this.$router.push({
          path: `/OrgRegister/orgInfoModify/mainInfoModify/${this.$route.params.id}/${this.$route.params.type}`
        });
      } else if (key == 3) {
        this.$router.push({
          path: `/OrgRegister/orgInfoModify/configModify/${this.$route.params.id}/${this.$route.params.type}`
        });
      }else if (key == 4) {
        this.$router.push({
          path: `/OrgRegister/orgInfoModify/benefitModify/${this.$route.params.id}/${this.$route.params.type}`
        });
      }

    }
  }
};
</script>
<style scoped>
/*滚动条样式*/
.tableClass1::-webkit-scrollbar {
  /*滚动条整体样式*/
  width: 4px; /*高宽分别对应横竖滚动条的尺寸*/
  height: 4px;
}
.tableClass1::-webkit-scrollbar-thumb {
  /*滚动条里面小方块*/
  border-radius: 5px;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  background: rgba(0, 0, 0, 0.2);
}
.tableClass1::-webkit-scrollbar-track {
  /*滚动条里面轨道*/
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.1);
}
</style>